#ifndef F_CAEmuBoardPlannerC_h
#define F_CAEmuBoardPlannerC_h

// ***********************************************************************

// class EDROOMTopContext

// ***********************************************************************



class EDROOMTopContext {

protected:

enum EDROOMCAEmuBoardPlannerSignal { EDROOMSignalTimeout, EDROOMSignalDestroy, SKeepOnComm, SToStandBy, STMToTransmit, SToComm, SInStandBy, STMTransmited, SCommConfigured, STCReceived, SCommInterrupted, SToListening };


	friend class CAEmuBoardPlanner;

	CAEmuBoardPlanner &EDROOMcomponent;

	CEDROOMMessage * &Msg;

	CEDROOMMessage * &MsgBack;

	//Ports

	CEDROOMInterface & EmuPlannerSGIControl;
	CEDROOMInterface & SSICtrl;
	CEDROOMTimingInterface & CommuteTimer;

	enum edroomStateId{I, SSICommunication, SGICommunication};

	enum IdTrans{Init, CommToSGI, CommToSSI, TMTxCompleted, TCRxCompleted, CommInterrupted,  EDROOMMEMORIA };

	//Constantes



	//Variables

	CEDROOMTimer &VIdTimer;
	bool_t &VTxCompleted;


	//Pool



	// CONSTRUCTORES

	EDROOMTopContext (CAEmuBoardPlanner &act, CEDROOMTimer & EDROOMpVarVIdTimer, bool_t & EDROOMpVarVTxCompleted );

	EDROOMTopContext ( EDROOMTopContext &contex );

public:

	bool EDROOMSearchContextTrans(TEDROOMTransId &edroomCurrentTrans);

	void EDROOMNuevoMens () { EDROOMcomponent.EDROOMNewMsg(); }

	// Funciones Definidas por el usuario

	void	FCommToSGI();

	void	FCommToSSI();

	void	FSGICommunication();

	void	FSGIKeepOn();

	void	FSGIToStandby();

	void	FSSICommunication();

};

// ***********************************************************************

// class EDROOMTopState

// ***********************************************************************



class EDROOMTopState : public EDROOMTopContext {

protected:



	EDROOMTopContext::edroomStateId edroomCurrentState;

	EDROOMTopContext::edroomStateId edroomNextState;

	//Variables

	CEDROOMTimer VIdTimer;
	bool_t VTxCompleted;


	//Pools



public:

	// CONSTRUCTOR

	EDROOMTopState (CAEmuBoardPlanner &act );


	// EDROOMBehaviour**********************************************

	void EDROOMBehaviour();

	// Inicio**********************************************

	void EDROOMInicio();

	// ***********************************************************************

	// SubEstado Inicial 

	// ***********************************************************************



	TEDROOMTransId EDROOMIllegada();

	// ***********************************************************************

	// SubEstado Hoja SSICommunication

	// ***********************************************************************



	TEDROOMTransId EDROOMSSICommunicationllegada();

	// ***********************************************************************

	// SubEstado Hoja SGICommunication

	// ***********************************************************************



	TEDROOMTransId EDROOMSGICommunicationllegada();

};


#endif
